package xkp.lesson4;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.util.Properties;

public class TestProperties {
	public static void main(String[] args) throws IOException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException {
		//从配置文件中获取类的名称，然后创建类的对象
		InputStream inputStream = TestProperties.class.getClassLoader().getResourceAsStream("config.properties");
		Properties properties = new Properties();
		properties.load(inputStream);
		String className = properties.getProperty("className");
		Object object = Class.forName(className).getConstructor(null).newInstance(null);
		System.out.println(object);
	}

}
